import {getBanners} from '../../network/api/getInfoData';

export const actionChangeNum = num => {
  return {
    type: 'CHANGE_NUM',
    num,
  };
};

export const actionChangeBanners = banners => {
  return {
    type: 'CHANGE_BANNERS',
    banners,
  };
};

export const actionGetBanners = () => {
  return dispatch => {
    getBanners().then(res => {
      dispatch(actionChangeBanners(res.data.banners));
    });
  };
};
